package keke;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;


class CalculateTask implements Callable<Integer>{
	private int n;

	public CalculateTask(int n) {
		super();
		this.n = n;
	}

	@Override
	public Integer call() throws Exception {
		int a=0;
		int b=1;
		int c;
		for(int i=2;i<=n;i++){
			c = a + b;
			a = b;
			b = c;
		}
		return a + b;
	}
}
public class Main0710 {
	public static void main(String[] args) throws InterruptedException {
        ExecutorService exec = Executors.newCachedThreadPool();
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();//num of tasks
        List<CalculateTask> taskList = new ArrayList<CalculateTask>();
        List<Future<Integer>> results = new ArrayList<Future<Integer>>();
        int sum = 0;
        for(int i=0;i<n;i++){
        	taskList.add(new CalculateTask(i));
        }
        try {
        	results = exec.invokeAll(taskList);
        	for (Future<Integer> future : results) {
            	sum+=future.get();
            }
        } catch (InterruptedException e) {
            e.printStackTrace();
        }  catch (ExecutionException e) {
            e.printStackTrace();
        }
        exec.shutdown();
        System.out.println("sum="+sum);
	}
}
